This invention relates to a method of detecting a bar code on a scan line, and to an apparatus for detecting and decoding a bar code.
A particular problem in plants for handling and sorting objects is that of quickly and univocally identifying the objects such that subsequent allotting operations can be speeded up and optimized.
In these plants, the objects to be identified are usually laid onto a feeding plane (e.g., a belt conveyor), and automatically identified by means of decoding bar codes carried on the objects themselves. The continuous movement of the feeding plane will take each object to a scan area, whereat a bar code scanner is provided which, once turned on, illuminates the code to be decoded along a read line (scan line); light scattered from spots on said line is picked up by a light-sensing element to generate an analog electric signal which is proportional to the intensity of the scattered light.
The analog signal thus generated is then processed in a digitalizer block, which will sample the signal to extract numerical features that are thoroughly representative of the signal, thereby to define a scan of the code on the object under examination.
This scan is processed through a bar code decoding program, to ultimately issue the sequence of the decoded characters of the bar code.
In conventional decoding processes, the laser beam continually sweeps across the scan area in a succession of linear scans. However, only a few of these scans are actually acquired and processed. In fact, scans "useful" to identify the object are only those effected along lines which cross the bar code. The acquisition and processing of all the code scans would slow down the decoding process and, therefore, be incompatible with the requirement for a high speed of response (a requirement due to that the objects only pass in the scan area for a short time).
In conventional decoding processes, the number of scans actually acquired and processed is far larger than that strictly necessary for reading the bar codes on the objects to be identified (the "useful" scans). In addition, once a scan is acquired, the scanner tries to decode the optical signal relating to all the samples of the scan line, regardless of whether they do or do not belong to bar code zones. All this is time consuming and cost intensive on account of the considerable storage and computing resources involved.
Thus, a need exists in this field for methods which be effective to detect the position of a likely bar code within a scan line. In this respect, the prior art method can be split into two basic categories:
methods based on analog circuits; PA1 methods based on the digital processing of two-dimensional optical images. PA1 c121) if so, iteratively repeating step c12) for h=h+1, until h=NTH; and thereafter, PA1 c122) if not so, iteratively repeating step c12) for k=k+h until k+h=K. PA1 c2111) if so, classifying as the transition point t.sub.j a point located at position Pt.sub.j, between the positions Pmx.sub.i and Pmx.sub.i+1, of the two peaks xm.sub.i and xm.sub.i+1 under consideration, updating j=j+1, and repeating step c211) for i=i+1 until the value of i+1 equals the number of peaks xm.sub.i found; PA1 c2112) if not so, repeating step c211) for i=i+1 until the value of i+1 equals the number of peaks xm.sub.i found. Even more preferably, the classified transition point t.sub.j occupies a position Pt.sub.j, located midway between positions Pmx.sub.i and Pmx.sub.i+1 of the two peaks xm.sub.i and xm.sub.i+ 1 considered. PA1 c321a) classifying zone Dz.sub.j as the initial zone of code Cm; PA1 c322a) classifying zone Dz.sub.j+1 as first element of code Cm; PA1 c323a) recording the size of zone Dz.sub.j+1 as the size of the smallest element (MINBARW) of code Cm; PA1 c324a) establishing a state of search for the intermediate zones of code Cm until the final zone of code Cm is found; PA1 c321b) repeating the steps from c32) onward, for j=j+1, to search for the initial zone of the code, until the value of j equals the number of transition points found plus 1. PA1 c324a1a) classifying zone Dz.sub.j as the final zone of code Cm; PA1 c324a2a) classifying zone Dz.sub.j-1 as the last element of code Cm; PA1 c324a3a) signaling, to a subsequent decoding process, the code Cm identified and a packet of detect information associated therewith; PA1 c324a4a) searching for the initial zone of a new potential code Cm+1 by repeating the steps from c32) onward, with j=j+1; PA1 c324a1b) if Dz.sub.j is smaller than the size of the smallest element found up to that time (MINBARW), updating this value by taking MINBARW=Dz.sub.j ; PA1 c324a2b repeating the steps from c324a) onward, until the value of j equals the number of transition points found plus 1.
While essentially achieving their objectives, either methods have, however, certain drawbacks.
The methods based on analog circuits do not lend themselves to use in a digital signal processing system like that employed for decoding bar codes. The methods based on two-dimensional image processing, on the other hand, require full acquisition of the entire two-dimensional image before processing can be initiated, and are thus very slow and expensive with regard to computing and storage resources.